import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './components/login.vue'
import Index from './components/index.vue'
import Register from './components/register.vue'
import Details from './views/details.vue'
import Nav from './views/nav.vue'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {path: '/',name: 'login',component: Login},
    {path: '/about',name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },
    {path:'/login',name:'login',component:Login},
    {path:'/index',name:'index',component:Index},
    {path:'/register',name:'register',component:Register},
    {path:'/details',name:'details',component:Details},
    {path:'/nav',name:"nav",component:Nav,children:
      [
        // 二级路由路径,不加
          {path:'details', component:Details},
          {path:'juese', component:Login},
          {path:'denglu', component:Register},
          {path:'caozuo', component:Home}
        ]
  
    }
  ]
})
